<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" xmlns="http://www.w3.org/1999/xhtml">

<head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <title>房屋租赁平台---用户中心</title>
  <script src="https://cdn.staticfile.org/jquery/1.10.2/jquery.min.js"></script>
  <link href="/static/img/logo500x500.png" rel="shortcut icon" sizes="500x500">
  <link rel="stylesheet" href="/static/my/fangyuan_files/common.css">
  <link rel="stylesheet" href="/static/my/fangyuan_files/main.css">
</head>

<body>
<div th:replace="common/head.html::banner(${user})"></div>
  <div class="user-main">
    <div class="main-left fl">
      <div style="text-align:center">
        <img id="" style="width:100px;
        height:100px;
        border-radius:8px;" th:src="${userInf.getProfill()}">
      </div>
      <div class="">

      </div>
      <div class="user-name">欢迎你</div>
      <ul>
        <li ><a href="/user/mine">我的资料</a></li>
        <li><a href="/user/myhouse">我发布的</a></li>
        <li ><a href="/user/collect">我收藏的</a></li>
        <li><a href="/house/newhouse" target="_blank">发布房源</a></li>
        <li><a href="/user/liuyan">我的留言板</a></li>
        <li class="hover"><a href="/user/news">合租需求</a></li>

      </ul>
    </div>
    <div class="main-right fr" id="allList">
      <div class="title" id="showTotal">共<span th:text="${newsVoList.size()}"></span>个 合租需求</div>


      <div class="all-list selected fav-list" style="display:block;" id="ershoufang">

        <ul class="list-bot">

          <li th:each="newsVo:${newsVoList}" class="LOGCLICKDATA" data-lj_view_evtid="23708" data-lj_evtid="23709" data-lj_view_event="ItemExpo" data-lj_click_event="WebClick" data-lj_action_click_position="0" data-lj_action_housedel_id="103109036876" data-lj_action_source_type="我关注的房源卡片">
            <div class="list">
              <div class="pic-panel">


                <a target="_blank" href="https://qd.lianjia.com/ershoufang/103109036876.html">

                  <img th:src="${newsVo.getHouseImage()}" onerror="this.src='https://s1.ljcdn.com/feroot/pc/asset/img/new-version/default_block.png?_v=2020120816522583';this.onerror=null;">


                </a>
              </div>
              <div class="info-panel">
                <h2>

                  <a target="_blank" th:href="'/house/inf/'+${newsVo.houseId}" th:text="${newsVo.houseTitle}">

                  </a>
                </h2>
                <div class="col-1">
                  <div class="where" style="overflow: visible">
                    <a th:href="'/house/inf/'+${newsVo.houseId}"target="_blank">
                      <span class="region" th:text="'联系方式：'+${newsVo.telphone}">&nbsp;&nbsp;</span>
                      <br>
                      <span th:text="'期望价格：'+${newsVo.price}"></span>
                      <br>
                      <span class="meters" th:text="'其他需求：'+${newsVo.inf}"></span>
                    </a>
                  </div>
                  <div class="other">
                  </div>
                </div>
                <div class="col-3">

                  <div class="price" th:if="${newsVo.status}==1">
                    <button id="argee" type="button" class="btn btn-default" style="width:80px;
height:30px;
background:rgb(55,166,227);
border-radius:8px;">
                      <span style="width:10px;
height:13px;
font-size:8px;
font-family:PingFangSC-Semibold,PingFang SC;
font-weight:600;
color:rgba(255,255,255,1);
line-height:21px;
text-shadow:0px 2px 4px rgba(134,253,133,0.3);" th:onclick="'agree('+${newsVo.id}+')'">同意</span>
                    </button>
                    <button th:onclick="'diagree('+${newsVo.id}+')'" id="delete" type="button" class="btn btn-default" style="width:80px;
height:30px;
background:rgb(227,58,52);
border-radius:8px;">
                      <span style="width:10px;
height:13px;
font-size:8px;
font-family:PingFangSC-Semibold,PingFang SC;
font-weight:600;
color:rgba(255,255,255,1);
line-height:21px;
text-shadow:0px 2px 4px rgba(134,253,133,0.3);">删除</span>
                    </button>
                  </div>
                  <div class="price" th:if="${newsVo.status}==2">
                    <div>已同意</div>
                  </div>
                </div>
              </div>
            </div>
          </li>
        </ul>
      </div>
    </div>
  </div>
<script>
  function agree(id) {
      $.ajax({
          url:'/agreeNews',
          type:'POST',
          dataType:'json',
          data:{id:id},
          success:function(data){
              //请求成功后执行的代码
              location.reload();
          },
          error:function(status){
              //失败后执行的代码
          }
      });

  }

  function diagree(id) {
      $.ajax({
          url:'/deleteNews',
          type:'POST',
          dataType:'json',
          data:{id:id},
          success:function(data){
              //请求成功后执行的代码
              location.reload();
         },
          error:function(status){
              //失败后执行的代码
          }
      });

  }
</script>
</body>

</html>